package com.hc.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Slf4j
@Controller
public class IndexController {

    @RequestMapping("/toLogin")
    public String toLogin() {
        System.out.println("to---login");
        return "login";
    }

    @GetMapping("/toMain")
    public String toMain() {
        return "main";
    }

    @RequestMapping("/toError")
    public String error(Model model) {
        model.addAttribute("msg", true);
        return "login";
    }

}
